package com.example.spring_mysql.entity;

import com.example.spring_mysql.datascope.EntityChangeListener
import com.mybatisflex.annotation.Column
import com.mybatisflex.annotation.Id
import com.mybatisflex.annotation.KeyType
import com.mybatisflex.annotation.Table
import java.io.Serializable;
import java.time.LocalDateTime

/**
 * <p>
 *
 * </p>
 *
 * @author hjw
 * @since 2025-06-11
 */
@Table(value = "user", onInsert = [EntityChangeListener::class], onUpdate = [EntityChangeListener::class])
class User : Serializable {

    @Id(keyType = KeyType.Auto) // ✅ 指定为自增主键
    var id: Long? = null

    var password: String? = null

    var username: String? = null

    var delete_time: LocalDateTime? = null
    var delete_id: Int? = null

    @Column(isLogicDelete = true)
    var is_deleted: String = "F"
    override fun toString(): String {

        return "User{" + "id=" + id + ", password=" + password + ", username=" + username + "+}"
    }
}
